package bpm.dao.impl.deptagenda;

import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.List;

import org.springframework.jdbc.core.BatchPreparedStatementSetter;

import bpm.domain.deptagenda.AgendaUser;
/**
 * 
 * @author wanglong635@126.com
 *
 */
public class AgendaDeptUserBatchSetter implements BatchPreparedStatementSetter {

	private List<AgendaUser> users;
	
	public AgendaDeptUserBatchSetter(List<AgendaUser> users){
		this.users = users;
	}
	
	public int getBatchSize() {
		return users.size();
	}

	public void setValues(PreparedStatement ps, int i) throws SQLException {
		AgendaUser user = users.get(i);
		ps.setString(1, user.getAgendaDept().getDeptCode());
		ps.setString(2, user.getUserId());
		ps.setString(3, user.getUserIndex());
	}

}
